-
Notifications
You must be signed in to change notification settings - Fork 151
feat(screenshot): Add threaded JPEG screenshots on F11 without game stalls #1785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(screenshot): Add threaded JPEG screenshots on F11 without game stalls #1785
Conversation
20a3df1 to
37bd840
Compare
|
Some initial thoughts:
|
|
Agree with Stubbjax. JPG 90 is big file. Better make it default 80. Replace BMP screenshot with PNG screenshot. PNG is lossless compressed and always better than BMP. Make F12 take JPG 80 screenshot. Make CTRL+F12 take PNG screenshot. Make JPG Quality adjustable. Remove the old BMP code(s) and only use the new code for screenshot. |
|
Regarding Github formatting: When you write
Then it will not close this report when this is merged. Please read up on it here: |
RE moving logic to core, I moved what I could to core - but there are a lot more files that need to be moved to core before this can be moved there eg WWVegas/WW3D2/* |
3535e1e to
efc773f
Compare
Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplay.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScreenshot.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScreenshot.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScreenshot.cpp
Outdated
Show resolved
Hide resolved
977a6dc to
f8162f3
Compare
d7e8a8d to
d197bdd
Compare
d197bdd to
9669966
Compare
|
Needs rebase. |
9669966 to
4897b0b
Compare
Done |
Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DScreenshot.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/stb_image_write_impl.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScreenshot.cpp
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
Outdated
Show resolved
Hide resolved
Skyaero42
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
9c99306 to
de35e57
Compare
|
I rebased again, and moved stb_image_write_impl to core. W3DScreenshot still needs to stay in separate game folders - it uses a relative path that would break if moved to Core |
44ca79d to
33f899b
Compare
Add takeScreenShotCompressed() to Display interface
Implement threaded JPEG screenshot for Generals Link stb library to GameEngineDevice targets Remove excessive comments from screenshot implementation
Add shared screenshot implementation in Core
Move W3DScreenshot implementation to game-specific directories Fix include order for VC6 precompiled headers Remove default parameter from function definition Move STB implementation to separate file to avoid PCH issues Include screenshot implementation directly in W3DDisplay.cpp to avoid PCH issues Use Windows constants and switch statement in screenshot code Use vcpkg for stb dependency with FetchContent fallback
…ince it's included in W3DDisplay.cpp
Move stb_image_write_impl.cpp from game-specific directories to Core since it's identical between Generals and GeneralsMD and contains only STB library implementation code with no game-specific logic.
33f899b to
7d40c12
Compare
Summary
Implements compressed JPEG screenshots (F11) that don't stall the game, addressing issues with the current F12 BMP screenshot functionality.
Closes #1555
Closes #106 ... sort of
Adds a new screenshot function using the stb_image_write library with background threading:
Notes
std::shared_ptrfor safe memory management across threadsTesting